package com.langsotech.studio.navigator.views.providers;
import java.net.URL;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jdt.internal.core.SourceMethod;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.swt.graphics.Image;
import org.osgi.framework.Bundle;
import com.langsotech.studio.navigator.model.Method4Bo;
public class BoImageLabelProvider implements ILabelProvider {
	@Override
	public Image getImage(Object element) {
		if (element instanceof Method4Bo) {
			return getDefaultPageImageDescriptor().createImage();
		}
		return null;
	}
	protected ImageDescriptor getDefaultPageImageDescriptor() {
		final Bundle bundle = Platform.getBundle("com.langsotech.studio.navigator");
		final URL url = bundle.getEntry("icons/full/obj16/method.png");
		return ImageDescriptor.createFromURL(url);
	}
	@Override
	public String getText(Object element) {
		if (element instanceof Method4Bo) {
			return ((Method4Bo)element).getMethodName();
		}
		return null;
	}
	@Override
	public void addListener(ILabelProviderListener listener) {
	}
	@Override
	public void dispose() {
	}
	@Override
	public boolean isLabelProperty(Object element, String property) {
		return false;
	}
	@Override
	public void removeListener(ILabelProviderListener listener) {
	}
}
